package com.benben.springSecurity.weiwei;

import java.util.ArrayList;
import java.util.List;

public class revertGame {
    public static  List<String> generatePossibleNextMoves(String s) {
        List<String> result = new ArrayList<>();
        for (int i =0;i<s.length();i++){
           StringBuilder temp = new StringBuilder(s);
            if(i == s.length()-1){
                return result;
            }
            if(s.charAt(i) == '+' && s.charAt(i)== s.charAt(i+1)){
               temp.replace(i,i+2,"--");
               result.add(temp.toString());
            }
        }
        return result;
    }
    public static void main(String[] args){
        System.out.println(generatePossibleNextMoves("++++"));
    }
}
